<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<f:view contentType="text/html">
	<h:head>
		<style type="text/css">@import url(../css/estilo.css);</style>
	</h:head>
	<h:body>
		<p:layout fullPage="true">

			<p:layoutUnit position="top" height="175" id="top_layout" resizable="false"
				closable="false" collapsible="false">
				<div align="center"><img src="../imagens/chamado_user.png"
					width="1000"></img></div>
			</p:layoutUnit>

			<p:layoutUnit position="bottom" height="30"
				header="Desenvolvido por André Ricardo Gnhoato • João Carlos V. Siqueira • Lubian Carmona • ©2011"
				resizable="false" closable="false" collapsible="true">
			</p:layoutUnit>

			<p:layoutUnit position="left" width="200" header="Menu"
				resizable="true" closable="false" collapsible="true">
				<h:form>
					<p:menu style="width:180px">
						<p:submenu label="Home">
							<p:menuitem value="Chamadas" action="User?faces-redirect=true" ajax="false" />
						</p:submenu>
						<p:submenu label="Chamadas" icon="ui-icon ui-icon-refresh">
							<p:menuitem value="Nova"
								action="#{chamadaController.novaChamada}" ajax="false"
								icon="ui-icon ui-icon-contact" />
						</p:submenu>
						<p:submenu label="Usuário" ajax="false">
							<p:menuitem
								value="Bem-vindo: #{UsuarioController.usuario.login}" />
							<p:menuitem value="Sair" action="#{UsuarioController.logout}"></p:menuitem>
						</p:submenu>
					</p:menu>
				</h:form>


			</p:layoutUnit>

			<!--    <p:layoutUnit position="right" width="200" header="Right" resizable="true" closable="true" collapsible="true">  -->
			<!--        <h:outputText value="East unit content." />  -->
			<!--    </p:layoutUnit>  -->

			<p:layoutUnit position="center" scrollable="true">
				<h:form id="formCadastro">
					<p:fieldset>
						<f:facet name="legend">
							<h:outputLabel value="Detalhe Chamada" />
						</f:facet>

						<h:panelGrid id="panel1" columns="2">
							<h:outputLabel value="Descrição: " />
							<p:inputTextarea id="descricao"
								value="#{chamadaController.chamada.descricao}"
								style="width:700px" disabled="true" />
							<h:outputLabel value="Data: " />
							<h:outputLabel style="font-weight:bold"
								value="#{chamadaController.chamada.data}" />

							<h:outputLabel value="Categoria: " />
							<h:outputLabel style="font-weight:bold"
								value="#{chamadaController.chamada.categoria}" />

							<h:outputLabel for="prioridade" value="Prioridade: " />
							<h:outputLabel style="font-weight:bold"
								value="#{chamadaController.chamada.prioridade}" />
						</h:panelGrid>
					</p:fieldset>
				</h:form>
				
				<h:form id="form">
				<p:fieldset>
						<f:facet name="legend">
							<h:outputLabel value=" Andamento da Chamada" />
						</f:facet>
						<p:growl id="msgs" showDetail="true" />
						<p:dataTable id="ands" var="anda" dynamic="true"
							value="#{chamadaController.chamada.andamentoList}"
							loadingMessage="Carregando..." paginator="true" rows="5"
							paginatorTemplate="   {PreviousPageLink} {NextPageLink} "
							>
							<p:column style="width: 100px">
								<f:facet name="header">
									<h:outputText value="Data" />
								</f:facet>
								<h:outputText value="#{anda.data}" />
							</p:column>					
							<p:column >
								<f:facet name="header">
									<h:outputText value="Descrição" />
								</f:facet>
								<h:outputText value="#{anda.descricao}" />
							</p:column>
							</p:dataTable>
						</p:fieldset>
				</h:form>
				
				
				<h:form>
					<p:fieldset>
						<f:facet name="legend">
							<h:outputLabel value="Novo Andamento" />
						</f:facet>
						<h:form>
							<p:messages />
							<h:panelGrid id="panelGrid" columns="3">
								<h:outputLabel for="andamento" value="Descrição:  " />
								<p:inputTextarea id="andamento"
									value="#{andamentoController.andamento.descricao}"
									style=" width : 700px;" required="true"
									requiredMessage="Campo Obrigatório" />
								<p:commandButton value="Salvar" image="ui-icon ui-icon-disk"
									action="#{andamentoController.cadastrarAndamento}" ajax="false">
								</p:commandButton>
							</h:panelGrid>

						</h:form>
					</p:fieldset>
				</h:form>
			</p:layoutUnit>

		</p:layout>
		<div id="logo"></div>
	</h:body>
</f:view>
</html>